package cn.netjava.softkid.chapter09;

public class RunnableDemoTest 
{
	public static void main(String args[])
	{
		Thread th[] = new Thread[5];
		th[0] = new Thread(new RunnableDemo("A"));
		th[1] = new Thread(new RunnableDemo("B"));
		th[2] = new Thread(new RunnableDemo("C"));
		th[3] = new Thread(new RunnableDemo("D"));
		th[4] = new Thread(new RunnableDemo("E"));
//		th[0].start();
//		th[1].start();
//		th[2].start();
//		th[3].start();
//		th[4].start();
		Thread t = Thread.currentThread();
		for(int i=0;i<5;i++)
		{
			th[i].start();
			System.out.println(t.getName()+":"+t.toString());
			System.out.println(th[i].getName()+":"+th[i].toString());
		}
		
	}
}
